import type { PageParam, PageResult } from '@vben/request';
import type { Dayjs } from 'dayjs';

import { requestClient } from '#/api/request';

export namespace BaseinfoDemandRecordApi {
  /** 需求记录信息 */
  export interface BaseinfoDemandRecord {
    id: number; // 序号
    demandName: string; // 需求名称
    demandNo: string; // 需求编码
    companyName: string; // 企业名称
    demandStatus: string; // 需求状态
    phone: string; // 联系电话
    userName: string; // 用户名称
  }
}

/** 查询需求记录分页 */
export function getBaseinfoDemandRecordPage(params: PageParam) {
  return requestClient.get<PageResult<BaseinfoDemandRecordApi.BaseinfoDemandRecord>>('/csyt/baseinfo-demand-record/page', { params });
}

/** 查询需求记录详情 */
export function getBaseinfoDemandRecord(id: number) {
  return requestClient.get<BaseinfoDemandRecordApi.BaseinfoDemandRecord>(`/csyt/baseinfo-demand-record/get?id=${id}`);
}

/** 新增需求记录 */
export function createBaseinfoDemandRecord(data: BaseinfoDemandRecordApi.BaseinfoDemandRecord) {
  return requestClient.post('/csyt/baseinfo-demand-record/create', data);
}

/** 修改需求记录 */
export function updateBaseinfoDemandRecord(data: BaseinfoDemandRecordApi.BaseinfoDemandRecord) {
  return requestClient.put('/csyt/baseinfo-demand-record/update', data);
}

/** 删除需求记录 */
export function deleteBaseinfoDemandRecord(id: number) {
  return requestClient.delete(`/csyt/baseinfo-demand-record/delete?id=${id}`);
}

/** 批量删除需求记录 */
export function deleteBaseinfoDemandRecordList(ids: number[]) {
  return requestClient.delete(`/csyt/baseinfo-demand-record/delete-list?ids=${ids.join(',')}`)
}

/** 导出需求记录 */
export function exportBaseinfoDemandRecord(params: any) {
  return requestClient.download('/csyt/baseinfo-demand-record/export-excel', params);
}

